<?php

class Empeval_Methods_Request_SetPositionBonusGroup {
	
	/**
	 *
	 * @var App_Methods_Data_App
	 */
	public $app;
	public $positionId;
	public $bonusGroupId;
	
	public function __construct($params) {
		$this->app = new App_Methods_Data_App($params->app);
		$this->positionId = $params->positionId;
		$this->bonusGroupId = $params->bonusGroupId;
	}
	
	public function process() {
		EmpevalPositionsQuery::create()
		->filterById($this->positionId)
		->update(array('BonusGroupId' => $this->bonusGroupId));
		
		return new Empeval_Methods_Response_SetPositionBonusGroup(true);
	}
	
}